/*
* Copyright (C) 2012 Manuel Pérez
*
* This file is part of OpenSudoku.
*
* OpenSudoku is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenSudoku is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenSudoku. If not, see <http://www.gnu.org/licenses/>.
*
*/
package igraf;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import java.awt.BorderLayout;

public class Faq extends Panela{
	private static final long serialVersionUID = -325817369810660013L;
	
	public Faq(String tituloa, ItzuliInterfazea itzuliInterfazea) {		
		super(tituloa);
		
		JPanel erdikoPanela = this.getErdikoPanela();
		erdikoPanela.setLayout(new BorderLayout(0, 0));
		JTextArea textArea = new JTextArea(5, 20);
		try {
			BufferedReader bf = new BufferedReader(new FileReader("./iturriak/FAQ.txt"));
			String datuak = "";
			String aux = bf.readLine();
			while (aux != null) {
				datuak += aux + "\n";
				//textArea.append(aux + "\n");
				aux = bf.readLine();
			}
			
			
			JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
			textArea.setEditable(false);
			textArea.setText(datuak);
			erdikoPanela.add(scrollPane);
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();	
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	   
		 
}

	@Override
	public void eremuakGarbitu() {
		// TODO Auto-generated method stub
		
	}
}
